package com.zzxx.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zzxx.mapper.SyslogMapper;
import com.zzxx.pojo.SysLog;
import com.zzxx.service.SyslogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class SyslogServiceImpl implements SyslogService {
    @Autowired
    private SyslogMapper syslogMapper;
    @Override
    public void addSyslog(SysLog sysLog) {
        syslogMapper.insertSyslog(sysLog);
    }

    @Override
    public PageInfo<SysLog> getAllSyslog(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        PageInfo<SysLog> pageInfo = new PageInfo<>(syslogMapper.queryAll());
        return pageInfo;
    }
}
